#include <vector>
#include <list>
#include <map>
#include <set>
#include <queue>
#include <deque>
#include <stack>
#include <bitset>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>
#include <sstream>
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <ctime>
#include <fstream>
#include <set>

using namespace std;

vector<int> get(int num[], int size)
{
    int sum = 0;
    int num1 = 0, num2 = 0, pos; 
    vector<int> ans;

    for (int i = 0; i < size; i++)
        sum ^= num[i];
    
    //find the first bit diff
    for (pos = 0; pos < 32; pos++) {
        if (sum & (1<<pos)) break;   
    }

    for (int i = 0; i < size; i++) {
        if (num[i] & (1 << pos)) 
            num1 ^= num[i];
        else 
            num2 ^= num[i];
    }
    cout << num1 << " " << num2 << endl;
    return ans;
}



int main(int argc, char **argv)
{
    cout << "-----------------Test 1--------------------" << endl;
    int test[] = {12, 23, 34, 12, 12, 23, 12, 45};
    vector<int> ans = get(test, sizeof(test)/sizeof(int));


    cout << "-----------------Test 2--------------------" << endl;
    int test2[] = {4, 4, 100, 5000, 4, 4, 4, 4, 100, 100};
    ans = get(test2, sizeof(test2)/sizeof(int));

    cout << "-----------------Test 3--------------------" << endl;


    cout << "-----------------Test 4--------------------" << endl;


    cout << "-----------------Test 5--------------------" << endl;



}
